Left Termination of the query pattern
w.r.t. the given Prolog program could successfully be proven:
↳ Prolog
↳ PrologToPiTRSProof
Clauses:
even(s(s(X))) :- even(X).
even(0).
lte(s(X), s(Y)) :- lte(X, Y).
lte(0, Y).
goal :- ','(lte(X, s(s(s(s(0))))), even(X)).
Queries:
goal().
We use the technique of [30].Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
goal_in → U3(lte_in(X, s(s(s(s(0))))))
lte_in(0, Y) → lte_out(0, Y)
lte_in(s(X), s(Y)) → U2(X, Y, lte_in(X, Y))
U2(X, Y, lte_out(X, Y)) → lte_out(s(X), s(Y))
U3(lte_out(X, s(s(s(s(0)))))) → U4(even_in(X))
even_in(0) → even_out(0)
even_in(s(s(X))) → U1(X, even_in(X))
U1(X, even_out(X)) → even_out(s(s(X)))
U4(even_out(X)) → goal_out
The argument filtering Pi contains the following mapping:
goal_in = goal_in
U3(x1) = U3(x1)
lte_in(x1, x2) = lte_in(x2)
s(x1) = s(x1)
0 = 0
lte_out(x1, x2) = lte_out(x1)
U2(x1, x2, x3) = U2(x3)
U4(x1) = U4(x1)
even_in(x1) = even_in(x1)
even_out(x1) = even_out
U1(x1, x2) = U1(x2)
goal_out = goal_out
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
Pi-finite rewrite system:
The TRS R consists of the following rules:
goal_in → U3(lte_in(X, s(s(s(s(0))))))
lte_in(0, Y) → lte_out(0, Y)
lte_in(s(X), s(Y)) → U2(X, Y, lte_in(X, Y))
U2(X, Y, lte_out(X, Y)) → lte_out(s(X), s(Y))
U3(lte_out(X, s(s(s(s(0)))))) → U4(even_in(X))
even_in(0) → even_out(0)
even_in(s(s(X))) → U1(X, even_in(X))
U1(X, even_out(X)) → even_out(s(s(X)))
U4(even_out(X)) → goal_out
The argument filtering Pi contains the following mapping:
goal_in = goal_in
U3(x1) = U3(x1)
lte_in(x1, x2) = lte_in(x2)
s(x1) = s(x1)
0 = 0
lte_out(x1, x2) = lte_out(x1)
U2(x1, x2, x3) = U2(x3)
U4(x1) = U4(x1)
even_in(x1) = even_in(x1)
even_out(x1) = even_out
U1(x1, x2) = U1(x2)
goal_out = goal_out
Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:
GOAL_IN → U31(lte_in(X, s(s(s(s(0))))))
GOAL_IN → LTE_IN(X, s(s(s(s(0)))))
LTE_IN(s(X), s(Y)) → U21(X, Y, lte_in(X, Y))
LTE_IN(s(X), s(Y)) → LTE_IN(X, Y)
U31(lte_out(X, s(s(s(s(0)))))) → U41(even_in(X))
U31(lte_out(X, s(s(s(s(0)))))) → EVEN_IN(X)
EVEN_IN(s(s(X))) → U11(X, even_in(X))
EVEN_IN(s(s(X))) → EVEN_IN(X)
The TRS R consists of the following rules:
goal_in → U3(lte_in(X, s(s(s(s(0))))))
lte_in(0, Y) → lte_out(0, Y)
lte_in(s(X), s(Y)) → U2(X, Y, lte_in(X, Y))
U2(X, Y, lte_out(X, Y)) → lte_out(s(X), s(Y))
U3(lte_out(X, s(s(s(s(0)))))) → U4(even_in(X))
even_in(0) → even_out(0)
even_in(s(s(X))) → U1(X, even_in(X))
U1(X, even_out(X)) → even_out(s(s(X)))
U4(even_out(X)) → goal_out
The argument filtering Pi contains the following mapping:
goal_in = goal_in
U3(x1) = U3(x1)
lte_in(x1, x2) = lte_in(x2)
s(x1) = s(x1)
0 = 0
lte_out(x1, x2) = lte_out(x1)
U2(x1, x2, x3) = U2(x3)
U4(x1) = U4(x1)
even_in(x1) = even_in(x1)
even_out(x1) = even_out
U1(x1, x2) = U1(x2)
goal_out = goal_out
EVEN_IN(x1) = EVEN_IN(x1)
U41(x1) = U41(x1)
U31(x1) = U31(x1)
U11(x1, x2) = U11(x2)
LTE_IN(x1, x2) = LTE_IN(x2)
GOAL_IN = GOAL_IN
U21(x1, x2, x3) = U21(x3)
We have to consider all (P,R,Pi)-chains
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
Pi DP problem:
The TRS P consists of the following rules:
GOAL_IN → U31(lte_in(X, s(s(s(s(0))))))
GOAL_IN → LTE_IN(X, s(s(s(s(0)))))
LTE_IN(s(X), s(Y)) → U21(X, Y, lte_in(X, Y))
LTE_IN(s(X), s(Y)) → LTE_IN(X, Y)
U31(lte_out(X, s(s(s(s(0)))))) → U41(even_in(X))
U31(lte_out(X, s(s(s(s(0)))))) → EVEN_IN(X)
EVEN_IN(s(s(X))) → U11(X, even_in(X))
EVEN_IN(s(s(X))) → EVEN_IN(X)
The TRS R consists of the following rules:
goal_in → U3(lte_in(X, s(s(s(s(0))))))
lte_in(0, Y) → lte_out(0, Y)
lte_in(s(X), s(Y)) → U2(X, Y, lte_in(X, Y))
U2(X, Y, lte_out(X, Y)) → lte_out(s(X), s(Y))
U3(lte_out(X, s(s(s(s(0)))))) → U4(even_in(X))
even_in(0) → even_out(0)
even_in(s(s(X))) → U1(X, even_in(X))
U1(X, even_out(X)) → even_out(s(s(X)))
U4(even_out(X)) → goal_out
The argument filtering Pi contains the following mapping:
goal_in = goal_in
U3(x1) = U3(x1)
lte_in(x1, x2) = lte_in(x2)
s(x1) = s(x1)
0 = 0
lte_out(x1, x2) = lte_out(x1)
U2(x1, x2, x3) = U2(x3)
U4(x1) = U4(x1)
even_in(x1) = even_in(x1)
even_out(x1) = even_out
U1(x1, x2) = U1(x2)
goal_out = goal_out
EVEN_IN(x1) = EVEN_IN(x1)
U41(x1) = U41(x1)
U31(x1) = U31(x1)
U11(x1, x2) = U11(x2)
LTE_IN(x1, x2) = LTE_IN(x2)
GOAL_IN = GOAL_IN
U21(x1, x2, x3) = U21(x3)
We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 6 less nodes.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN(s(s(X))) → EVEN_IN(X)
The TRS R consists of the following rules:
goal_in → U3(lte_in(X, s(s(s(s(0))))))
lte_in(0, Y) → lte_out(0, Y)
lte_in(s(X), s(Y)) → U2(X, Y, lte_in(X, Y))
U2(X, Y, lte_out(X, Y)) → lte_out(s(X), s(Y))
U3(lte_out(X, s(s(s(s(0)))))) → U4(even_in(X))
even_in(0) → even_out(0)
even_in(s(s(X))) → U1(X, even_in(X))
U1(X, even_out(X)) → even_out(s(s(X)))
U4(even_out(X)) → goal_out
The argument filtering Pi contains the following mapping:
goal_in = goal_in
U3(x1) = U3(x1)
lte_in(x1, x2) = lte_in(x2)
s(x1) = s(x1)
0 = 0
lte_out(x1, x2) = lte_out(x1)
U2(x1, x2, x3) = U2(x3)
U4(x1) = U4(x1)
even_in(x1) = even_in(x1)
even_out(x1) = even_out
U1(x1, x2) = U1(x2)
goal_out = goal_out
EVEN_IN(x1) = EVEN_IN(x1)
We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
Pi DP problem:
The TRS P consists of the following rules:
EVEN_IN(s(s(X))) → EVEN_IN(X)
R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PiDP
Q DP problem:
The TRS P consists of the following rules:
EVEN_IN(s(s(X))) → EVEN_IN(X)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- EVEN_IN(s(s(X))) → EVEN_IN(X)
The graph contains the following edges 1 > 1
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
Pi DP problem:
The TRS P consists of the following rules:
LTE_IN(s(X), s(Y)) → LTE_IN(X, Y)
The TRS R consists of the following rules:
goal_in → U3(lte_in(X, s(s(s(s(0))))))
lte_in(0, Y) → lte_out(0, Y)
lte_in(s(X), s(Y)) → U2(X, Y, lte_in(X, Y))
U2(X, Y, lte_out(X, Y)) → lte_out(s(X), s(Y))
U3(lte_out(X, s(s(s(s(0)))))) → U4(even_in(X))
even_in(0) → even_out(0)
even_in(s(s(X))) → U1(X, even_in(X))
U1(X, even_out(X)) → even_out(s(s(X)))
U4(even_out(X)) → goal_out
The argument filtering Pi contains the following mapping:
goal_in = goal_in
U3(x1) = U3(x1)
lte_in(x1, x2) = lte_in(x2)
s(x1) = s(x1)
0 = 0
lte_out(x1, x2) = lte_out(x1)
U2(x1, x2, x3) = U2(x3)
U4(x1) = U4(x1)
even_in(x1) = even_in(x1)
even_out(x1) = even_out
U1(x1, x2) = U1(x2)
goal_out = goal_out
LTE_IN(x1, x2) = LTE_IN(x2)
We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
Pi DP problem:
The TRS P consists of the following rules:
LTE_IN(s(X), s(Y)) → LTE_IN(X, Y)
R is empty.
The argument filtering Pi contains the following mapping:
s(x1) = s(x1)
LTE_IN(x1, x2) = LTE_IN(x2)
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
LTE_IN(s(Y)) → LTE_IN(Y)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- LTE_IN(s(Y)) → LTE_IN(Y)
The graph contains the following edges 1 > 1